import { createRouter, createWebHistory } from 'vue-router'

import IndexView from '@/views/index/index.vue';
import ClazzView from '@/views/clazz/index.vue';
import DeptView from '@/views/dept/index.vue';
import EmpView from '@/views/emp/index.vue';
import LayoutView from '@/views/layout/index.vue';
import LogView from '@/views/log/index.vue';
import LoginView from '@/views/login/index.vue';
import EmpReportView from '@/views/report/emp/index.vue';
import StuReportView from '@/views/report/stu/index.vue';
import StuView from '@/views/stu/index.vue';
import PasswordView from '@/views/mima/index.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
      {
        path:'/',
        name:'main',
        component: ()=>import('@/views/Mainview/index.vue')
      },
      {
        path:'/layout',
        name:'',
        component:LayoutView,
        // 重定向
        redirect:'/index',
        children:[
          {path:'/index',name:'index',component:IndexView},
          {path:'/clazz',name:'clazz',component:ClazzView},
          {path:'/dept',name:'dept',component:DeptView},
          {path:'/emp',name:'emp',component:EmpView},
          {path:'/layout',name:'layout',component:LayoutView},
          // {path:'/log',name:'log',component:LogView},
          {path:'/empReport',name:'empReport',component:EmpReportView},
          {path:'/stuReport',name:'stuReport',component:StuReportView},
          {path:'/stu',name:'stu',component:StuView},
          {path:'/password',name:'password',component:PasswordView}
        ]
      },
      {path:'/login',name:'login',component:LoginView},
      {path:'/stulogin',name:'stulogin',component:()=>import('../views/CourseSelection/studentLogin/index.vue') },
      {path:'/xuanke',name:'',component:()=>import('../views/CourseSelection/index.vue'),
        redirect:'/student',
        children:[
          {path:'/java',name:'java',component:()=>import('../views/CourseSelection/java/index.vue')},
          {path:'/python',name:'python',component:()=>import('../views/CourseSelection/python/index.vue')},
          {path:'/qianduan',name:'qianduan',component:()=>import('../views/CourseSelection/qianduan/index.vue')},
          {path:'/bigdata', name:'bigdata', component:()=>import('../views/CourseSelection/bigdata/index.vue')},
          {path:'/go', name:'go', component:()=>import('../views/CourseSelection/go/index.vue')},
          {path:'/qianrusi', name:'qianrusi', component:()=>import('../views/CourseSelection/qianrusi/index.vue')},
          {path:'/yixuan', name:'yixuan', component:()=>import('../views/CourseSelection/yixuan/index.vue')},
          {path:'/student', name:'student', component:()=>import('../views/CourseSelection/index/index.vue')}
        ]
      }
  ]
})

export default router
